package com.nostra13.example.universalimageloader;

import android.graphics.Bitmap;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.assist.LoadedFrom;
import com.nostra13.universalimageloader.core.display.BitmapDisplayer;
import com.nostra13.universalimageloader.core.imageaware.ImageAware;

public class ScaleBitmapDisplayer implements BitmapDisplayer {

	@Override
	public void display(Bitmap bitmap, ImageAware imageAware,
			LoadedFrom loadedFrom) {
		float fromScale = (float) 0.9, toScale = (float) 1.0;
		imageAware.setImageBitmap(bitmap);
		View imgLogo = imageAware.getWrappedView();
		Animation anim = new ScaleAnimation(fromScale, toScale, fromScale,
				toScale, imgLogo.getWidth() / 2, imgLogo.getHeight() / 2);
		anim.setDuration(1000);
		anim.setFillEnabled(true);
		anim.setFillAfter(true);
		imgLogo.startAnimation(anim);

	}

}
